<?php

abstract class LikeMVC_Http_Request_Abstract {

	protected $componentName;
	
	protected $moduleName;
	
	protected $taskName;
	
	protected $params;
	
	public function __construct()	{
		$this->params = array();
	}
	
	/**
	 * @return the $componentName
	 */
	public function getComponentName() {
		return $this->componentName;
	}

	/**
	 * @return the $moduleName
	 */
	public function getModuleName() {
		return $this->moduleName;
	}

	/**
	 * @return the $taskName
	 */
	public function getTaskName() {
		return $this->taskName;
	}

	/**
	 * @param field_type $componentName
	 */
	public function setComponentName($componentName) {
		$this->componentName = $componentName;
	}

	/**
	 * @param field_type $moduleName
	 */
	public function setModuleName($moduleName) {
		$this->moduleName = $moduleName;
	}

	/**
	 * @param field_type $taskName
	 */
	public function setTaskName($taskName) {
		$this->taskName = $taskName;
	}
	
	/**
	 * Retrieves the specified parameter of the current request
	 * @param unknown_type $name the parameter name
	 * @param unknown_type $default the default value, if the parameter is not set
	 */
	public function getParam($name, $default=null)	{
		if ($this->hasParam($name))	{
			return $this->params[$name];
		}
		return $default;
	}
	
	/**
	 * Change the specified parameter of the current request
	 * @param unknown_type $name the parameter name
	 * @param unknown_type $value the new value
	 */
	public function setParam($name, $value)	{
		$this->params[$name] = $value;
	}
	
	/**
	 * Test if the specified parameter exists in the current request
	 * @param unknown_type $name
	 */
	public function hasParam($name)	{
		return (isset($this->params[$name]));
	}
	
	/**
	 * Get all parameters of the current request
	 */
	public function getParams()	{
		return $this->params;
	}
}

?>